package com.org.entity.sys;

import com.org.entity.base.BaseEntity;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotBlank;
import java.util.Date;

@Data
@Table(name = "SYS_DICT_ITEM")
public class SysDictItem extends BaseEntity {

    /**
     * 字典项编码
     */
    @Column(name = "CODE")
    @Length(min = 0,max = 64,message = "字典项编码不能超过64")
    @NotBlank(message = "字典项编码不能为空！")
    private String code;

    /**
     * 字典项名称
     */
    @Column(name = "NAME")
    @NotBlank(message = "字典项名称不能为空！")
    private String name;

    /**
     * 字典项值
     */
    @Column(name = "ITEM_VALUE")
    @NotBlank(message = "字典项值不能为空！")
    private String itemValue;

    /**
     * 父节点ID
     */
    @Column(name = "PID")
    private String pid;

    /**
     * 字典分类编码
     */
    @Column(name = "FK_DICT_CATEGORY_CODE")
    private String fkDictCategoryCode;

    /**
     * 排序
     */
    @Column(name = "SORT")
    private int sort;

    /**
     * 创建人
     */
    @Column(name = "ADD_USER_ID")
    private String addUserId;

    /**
     * 创建时间
     */
    @Column(name = "ADD_TIME")
    private Date addTime;

    /**
     * 修改时间
     */
    @Column(name = "MODIFY_TIME")
    private Date modifyTime;

    /**
     * 修改人
     */
    @Column(name = "MODIFY_USER_ID")
    private String modifyUserId;

    /**
     * 父节点名称
     */
    @Transient
    private String pname;


}


